﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#if DOT_NET
using Microsoft.VisualStudio.TestTools.UnitTesting;
#else
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
#endif
using StyleMVVM.UnitTests.TestClasses.SimpleObjects;
using StyleMVVM.DependencyInjection;

namespace StyleMVVM.UnitTests.DependencyInjection
{
	[TestClass]
	public class RemoveStrategyTests : BaseTestClass
	{
		[TestMethod]
		public void RemoveStrategyTest()
		{
			IEnumerable<IExportStrategy> allStrategies = Container.GetAllStrategies();

			IExportStrategy strategy =
				allStrategies.First(x => x.ExportedTypes != null && x.ExportedTypes.Contains(typeof(IExportByInterfaceClass)));

			Container.RemoveStrategy(strategy);

			IEnumerable<IExportStrategy> strategies = Container.GetAllStrategies();

			Assert.IsFalse(strategies.Contains(strategy));
		}
	}
}